package test.com.sms.selenium.sc.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class ScDispatchDefaultPageUtil extends SeleniumPageUtil 
{
//	public final static By SC_AREA_LOG_OUT = By.xpath("//*[@id='Map']/area");
	public final static By SC_AREA_LOG_OUT = By.xpath("//div[@class='headerLinkContainer']");
	public final static By SC_DIV_MAP = By.id("map-canvas");
	public final static By SC_TABLE_TICKS_LIST = By.xpath("//*[@id='tickets']/tbody");

	// the words 'TEST SITE'
	public final static By DISPATCH_FONT_TEST_SITE = By.xpath("html/body/center/h4/font");
	
	// elements under SMS Operations dom
	public final static By SC_LINK_DISPATCH = By.xpath("//a[@href='dispatchmain.cfm']");
	
	public final static By SC_IMG_FE = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[1]/table/tbody/tr/td[1]/img");
	public final static By SC_IMG_ON_SCHEDULE = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[1]/table/tbody/tr/td[2]/form/input[3]");
	public final static By SC_IMG_UNASSIGNED = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[1]/table/tbody/tr/td[3]/form/input[3]");
	public final static By SC_IMG_SLA_ALERT  = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[1]/table/tbody/tr/td[4]/form/input[3]");
	public final static By SC_INPUT_DATE = By.id("datepick2");
	public final static By SC_SELECT_STATUS = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[2]/table/tbody/tr/td[1]/form/select[1]");
	public final static By SC_SELECT_REGION = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[2]/table/tbody/tr/td[1]/form/select[2]");
	public final static By SC_SELECT_STATE = By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[2]/table/tbody/tr/td[1]/form/select[3]");
	public final static By SC_BUTTON_FILTER_LIST= By.xpath("html/body/div[3]/div[2]/table[1]/tbody/tr/td[2]/table/tbody/tr/td[2]/input");
	public final static By SC_BUTTON_MAKE_RECOMMENDATION = By.id("makeRecommendations");
	
	// elements of ticket list in dispatch page
	public final static By SC_TD_TICKET = By.xpath("//div[1]/table/thead[1]/tr/th[text()='Ticket']");
	public final static By SC_TD_PRIORITY = By.xpath("//div[1]/table/thead[1]/tr/th[text()='Priority']");
	public final static By SC_TD_SLA_DATE_TIME = By.xpath("//div[1]/table/thead[1]/tr/th[text()='Sla Date Time']");
	public final static By SC_TD_CUSTOMER = By.xpath("//div[1]/table/thead[1]/tr/th[text()='Customer']");
	public final static By SC_TD_LOCATION = By.xpath("//div[1]/table/thead[1]/tr/th[text()='Location']");
	// records of ticket list
	public final static By SC_LINK_TICKET_VALUE = By.xpath("//*[@id='tickets']/tbody/tr/td[2]/a");
	public final static By SC_TD_PRIORITY_VALUE = By.xpath("//*[@id='tickets']/tbody/tr/td[3]");
	public final static By SC_TD_SLA_DATE_TIME_VALUE = By.xpath("//*[@id='tickets']/tbody/tr/td[4]");
	public final static By SC_TD_CUSTOMER_VALUE = By.xpath("//*[@id='tickets']/tbody/tr/td[5]");
	public final static By SC_TD_LOCATION_VALUE = By.xpath("//*[@id='tickets']/tbody/tr/td[6]");
	// checkboxes of ticket list
	public final static By SC_CHECK_BOXES_TICKET_LIST = By.id("workorder_id");
	
	// Icon of first ticket's information
	public final static By SC_IMG_FIRST_TICKET_INFO = By.xpath("//*[@id='tickets']/tbody/tr[1]/td[8]/div/img");
	
	// Elements of make recommendation page
	public final static By SC_BUTTON_CLOSE_COMMENDATION = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[1]/td/input");
	public final static By SC_BUTTON_FILTER_FE_LIST_COMMENDATION = By.id("filterListButton");
	public final static By SC_SPAN_EMPLOYMENT_TYPE = By.id("employmentType");
	
	// Elements of Filter FE List page under make recommendation
	public final static By SC_INPUT_SERVICE_RADIUS = By.id("service_radius");
	public final static By SC_INPUT_NUMBER_OF_RESULTS = By.id("number_of_results");
	public final static By SC_SELECT_RESOURCE_TYPE = By.id("employment_sub_type");
	public final static By SC_SELECT_RESOURCE_STATUS = By.id("resource_status");
	public final static By SC_INPUT_INCLUDE_ON_LEAVE = By.id("include_on_leave");
	public final static By SC_INPUT_INCLUDE_SIMILAR_SKILLS = By.id("include_similar_skills");
	public final static By SC_BUTTON_CANCEL = By.id("btnCancel");
	public final static By SC_BUTTON_SUBMIT = By.id("btnFeFilter");
	
	// Elements of FE
	public final static By SC_TD_DISTANCES = By.xpath("//*[@id='activator']/table/tbody/tr[5]/td[2]");
	
	// Elements of index page
	public final static By SC_TD_PRIORITY_INDEX = By.xpath("//*[@id='ticketsform']/table/tbody/tr/td[3]");
	
	// Ticket's details in make recommendations page
	public final static By SC_TABLE_TICKET_DETAILS = By.id("dropTable1");
	public final static By SC_IMG_TICKET_INFO = By.xpath("//*[@id='dropTable1']/tbody/tr[1]/td[8]/div/img");
	public final static By SC_TH_SELECT = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[1]");
	public final static By SC_TH_TICKET_NUMBER = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[2]");
	public final static By SC_TH_PRIORITY = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[3]");
	public final static By SC_TH_CALL_DATE_TIME = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[4]");
	public final static By SC_TH_COMPANY = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[5]");
	public final static By SC_TH_CITY_STATE = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[6]");
	public final static By SC_TH_CITY_STATUS = By.xpath("//*[@id='detailsContainer']/table[1]/tbody/tr[2]/td[1]/table/tbody/tr/th[7]");
	
	// FEs in make recommendations page
	public final static By SC_TR_FE = By.id("main");
	public final static By SC_SPAN_STATUS_NOTE = By.xpath("//*[@id='activator']");
	public final static By SC_DIV_FE_RESULTS_TOTAL = By.xpath("//*[@id='FEListing']//span/div");
	
	// Elements of view FE
	public final static By SC_BUTTON_VIEW = By.id("techTrigger");
	public final static By SC_B_EMPLOYMENT_TYPE = By.xpath("//*[@id='RecommendedFEDetails_lblResults']/div/div[2]/div[2]/div[2]/b[1]");
	public final static By SC_B_PHONE = By.xpath("//*[@id='RecommendedFEDetails_lblResults']/div/div[2]/div[2]/div[2]/b[2]");
	public final static By SC_B_LAST_YEAR_ASSIGNMENT = By.xpath("//*[@id='RecommendedFEDetails_lblResults']/div/div[2]/div[2]/div[2]/b[4]");
	public final static By SC_STRONG_SELECTED_TICKETS = By.xpath("//*[@id='RecommendedFEDetails_lblResults']/fieldset[1]/legend/strong");
	public final static By SC_STRONG_CURRENT_ASSIGNMENTS = By.xpath("//*[@id='RecommendedFEDetails_lblResults']/fieldset[2]/legend/strong");
	public final static By SC_STRONG_CERTIFICATIONS = By.xpath("//*[@id='RecommendedFEDetails_lblResults']/fieldset[5]/legend/strong");
	
	// Elements about drag FE
	public final static By SC_SELECT_NOTE = By.id("frmContactMessage");
	public final static By SC_BUTTON_OK_DRAG_FE = By.id("submitNote");
	public final static By SC_TR_FE_TICKET = By.xpath("//*[@id='dropTable1']/tbody/tr");
	
	// Elements of assigning FE
	public final static By SC_INPUT_ASSIGN = By.id("rAssign");
	public final static By SC_INPUT_RATE = By.id("rRate");
	public final static By SC_BUTTON_ASSIGN_FE = By.xpath("//*[@id='assignmentRate']/table[2]/tbody/tr/td[2]/div");
	
	// Elements of remove FE
	public final static By SC_BUTTON_REMOVE_FE_TO_TICKET = By.xpath("//*[@id='dropTable1']/tbody/tr/td/div[text()='Remove']");
	public final static By SC_BUTTON_ASSIGN_FE_TO_TICKET = By.xpath("//*[@id='dropTable1']/tbody/tr/td/div[text()='Assign']");
	public final static By SC_INPUT_REMOVE_FE = By.id("removalReason");
	public final static By SC_BUTTON_YES_REMOVE_FE = By.id("removeTech");
	
	// Elements of ticket's info 
	public final static By SC_TAB_CUSTOMER_NOTE = By.xpath("//*[@id='myPopupDiv']/table/tbody/tr[5]/td/table/tbody/tr[1]/td[1]/a/font");
	public final static By SC_TAB_HELP_DESK_NOTE = By.xpath("//*[@id='myPopupDiv']/table/tbody/tr[5]/td/table/tbody/tr[1]/td[2]/a/font");
	public final static By SC_TD_RECENTLY_NOTE = By.xpath("//*[@id='myPopupDiv']/table/tbody/tr[5]/td/table/tbody/tr[1]/td[3]/a/font");
	
	public static void waitForScDefaultPageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				SC_AREA_LOG_OUT, SC_DIV_MAP, SC_TABLE_TICKS_LIST
		});
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(SC_DIV_MAP)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(SC_TABLE_TICKS_LIST)));
	}
}
